package me.zhengjie.pojo.dto;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Objects;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class InventoryContrast {

    //物料条码
    private String itemBarCode;

    //数量
    private double inventoryQuantity;

    @Override
    public String toString() {
        return "InventoryContrast{" +
                "itemBarCode='" + itemBarCode + '\'' +
                ", inventoryQuantity=" + inventoryQuantity +
                '}';
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        InventoryContrast that = (InventoryContrast) o;
        return Double.compare(inventoryQuantity, that.inventoryQuantity) == 0 && Objects.equals(itemBarCode, that.itemBarCode);
    }

    @Override
    public int hashCode() {
        return Objects.hash(itemBarCode, inventoryQuantity);
    }
}
